import datetime

from jinja2 import Environment, FileSystemLoader

import GetYamlFile


def template_test (title,body,expiredBug):
    file_path = GetYamlFile.getBugPath("templatePath")
    env =Environment(loader=FileSystemLoader(file_path))
    template = env.get_template('template.html')
    html_content = template.render(title=title, body=body,expiredBug=expiredBug)
    print(html_content)
    return  html_content
if __name__ == '__main__':
        title = datetime.datetime.now().strftime('%Y-%m-%d')
        body= [{"projectName":"消防大平台","bugTol":10,"NumberOfUnresolvedBugs":1,"numberOfNewBugs":2,"bugSolveToday":3,"bugClosedToday":4}]
        expiredBug=[]
        template_test(title,body,expiredBug)